package com.killer.catalina;

import org.apache.commons.collections4.CollectionUtils;

import java.util.List;

/**
 * Server的实现类
 */
public class StandardServer implements Server{

    /**
     * 一个Server下可以配置多个Service
     */
    private List<Service> serviceList;

    public List<Service> getServiceList() {
        return serviceList;
    }

    public void setServiceList(List<Service> serviceList) {
        this.serviceList = serviceList;
    }

    @Override
    public void start() {
        if (CollectionUtils.isNotEmpty(serviceList)) {
            //启动下面所有的service
            for (Service service : serviceList) {
                service.start();
            }
        }
    }
}
